﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MapTileUi : BaseUi
{
    /** 地块儿半宽 */
    private static int SIZE_WIDTH_HALF = 77;
    /** 地块儿半高 */
    private static int SIZE_HEIGHT_HALF = 36;
    public int dataX;
    public int dataY;

    public void refreshPosition()
    {
        float x = (this.dataX - this.dataY) * SIZE_WIDTH_HALF;
        float y = -(this.dataX + this.dataY) * SIZE_HEIGHT_HALF;
        rt.offsetMin = new Vector2(x - SIZE_WIDTH_HALF, y - SIZE_HEIGHT_HALF);
        rt.offsetMax = new Vector2(x + SIZE_WIDTH_HALF, y + SIZE_HEIGHT_HALF);
    }
}
